@page
@using EasyAbp.SharedResources.Authorization
@using EasyAbp.SharedResources.Localization
@using EasyAbp.SharedResources.Web.Pages.SharedResources.ResourceItems.ResourceItem
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.AspNetCore.Mvc.UI.Layout
@model IndexModel
@inject IAuthorizationService Authorization
@inject IHtmlLocalizer<SharedResourcesResource> L
@inject IPageLayout PageLayout
@{
    PageLayout.Content.Title = L["ResourceItem"].Value;
    PageLayout.Content.BreadCrumb.Add(L["Menu:ResourceItem"].Value);
    PageLayout.Content.MenuItemName = "EasyAbpSharedResourcesCategory";
}

@section scripts
{
    <abp-script src="/Pages/SharedResources/ResourceItems/ResourceItem/index.js" />
}
@section styles
{
    <abp-style src="/Pages/SharedResources/ResourceItems/ResourceItem/index.css"/>
}
<script>
    let resourceId = '@Model.ResourceId';
</script>

<abp-card>
    <abp-card-header>
        <abp-row>
            <abp-column size-md="_6">
                <abp-card-title>@L["ResourceItem"]</abp-card-title>
            </abp-column>
            <abp-column size-md="_6" class="text-right">
                @if (await Authorization.IsGrantedAsync(SharedResourcesPermissions.Resources.Create))
                {
                    <abp-button id="NewResourceItemButton"
                                text="@L["CreateResourceItem"].Value"
                                icon="plus"
                                button-type="Primary" />
                }
            </abp-column>
        </abp-row>
    </abp-card-header>
    <abp-card-body>
        <abp-table striped-rows="true" id="ResourceItemTable" class="nowrap">
            <thead>
            <tr>
                <th>@L["Actions"]</th>
                <th>@L["ResourceItemName"]</th>
                <th>@L["ResourceItemIsPublished"]</th>
                <th>@L["ResourceItemIsPublic"]</th>
            </tr>
            </thead>
        </abp-table>
    </abp-card-body>
</abp-card>